% TEST_ID: LANG-EXPAND-0041
% CATEGORY: language/array-ops/ops
% 测试 ~ 运算符

function test_not
    A = logical([0, 1, 0, 1]);
    assert(isequal(~A, [1 0 1 0])); % Test logical NOT operation

    A = [1, 2, 0, 4];
    B = ~A; % This will convert to logical and then negate
    assert(isequal(B, logical([0, 0, 1, 0]))); % Test logical NOT on numeric array
    assert(isequal(class(B), 'logical'));
end

